﻿#pragma once

#include "AutoRecycleBuffer.h"

class CVulkanVertexBuffer
{
public:
    CVulkanVertexBuffer(uint64_t InSize);

    void WriteData(const void* Data, uint64_t InSize);

    vk::Buffer GetBuffer() const { return AutoRecycleBuffer.Buffer; }
    uint32_t GetOffset() const { return  0; }

    uint64_t GetSize() const { return Size; }
protected:
    uint64_t Size=0;
    SVulkanAutoRecycleBuffer AutoRecycleBuffer;



};


class CVulkanIndexBuffer
{
public:
    CVulkanIndexBuffer(uint64_t InSize);

    void WriteData(const void* Data, uint64_t InSize);


    vk::Buffer GetBuffer() const { return  AutoRecycleBuffer.Buffer; }
    uint32_t GetOffset() const { return  0; }

    uint64_t GetSize() const { return Size; }
protected:

    uint64_t Size=0;
    SVulkanAutoRecycleBuffer AutoRecycleBuffer;

};

//普通的UniformBuffer
//默认大小为0
class CVulkanUniformBuffer
{
public:
    CVulkanUniformBuffer()=default;

    void WriteData(const void* Data, uint64_t InSize);

    void Resize(uint64_t InSize);

    vk::Buffer GetBuffer() const { return  AutoRecycleBuffer.Buffer; }
    uint32_t GetOffset() const { return  0; }
    uint64_t GetSize() const { return Size; }
protected:

    uint64_t Size=0;
    SVulkanAutoRecycleBuffer AutoRecycleBuffer;

};    

